package com.tensquare.article.controller;


import com.tensquare.article.service.ArticleService;
import entity.Result;
import entity.StatusCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("article")
public class ArticleController {

    @Autowired
    private ArticleService articleService;

    @PutMapping("examine/{articleId}")
    public Result examine(@PathVariable String articleId){
        //1.进行文章审核
        articleService.examine(articleId);
        //2.返回结果
        return new Result(true,StatusCode.OK,"文章审核通过！");
    }
}
